public class Test {
    public static int divide1(int n){
        int sum = 0;
        if(n < 10){
            sum += n;
        }else{
            sum += n % 10;
            sum += divide1(n / 10);
        }
         return sum;
    }

    public static void main(String[] args) {
        int ret = divide1(1234);
        System.out.println(ret);
    }

    public static void divide(int n){
        if(n < 10){
            System.out.println(n);
            return;
        }else{
            divide(n / 10);
            System.out.println(n % 10);
        }
    }

    public static void main5(String[] args) {
        divide(1234);
    }

    public static int Diliver2(int n){
        if(n == 1){
            return 1;
        }else
            return n + Diliver2(n - 1);
    }

    public static void main4(String[] args) {
        System.out.println(Diliver2(10));
    }

    public static int Diliver1(int n){
       if(n == 1){
           return 1;
       }else
         return n * Diliver1(n - 1);
    }

    public static void main3(String[] args) {
        //n * (n - 1)
        System.out.println(Diliver1(5));
    }

    public static int maxNum(int a,int b){
        int ret = a > b ? a : b;
        return ret;
    }
    public static double maxNum(double a,double b, double c){
        double ret = (a > b ? a : b) > c ? (a > b ? a : b) : c;
        return ret;
    }

    public static void main2(String[] args) {
        int num1 = maxNum(45,74);
        double num2 = maxNum(34.5,63.2,49.4);
        System.out.println(num1);
        System.out.println(num2);
    }

    public static int addInt(int a, int b) {
        int sum = a + b;
        return sum;
    }

    public static double addDouble(double a, double b, double c) {
        double sum = a + b + c;
        return sum;
    }

    public static void main1(String[] args) {
        int ret1 = addInt(5, 7);
        double ret2 = addDouble(4.5, 7.8, 4.67);

        System.out.println(ret1);
        System.out.println(ret2);
    }
}